package models

import "time"

var (
	UserSubscribeStatus       map[int]string
	UserStatus                map[int]string
	UserIsReceiveWechatNotice map[int]string
)

// 会员
type User struct {
	Id                        int64     `orm:"description(自增主键)"`
	OpenId                    string    `orm:"description(微信公众平台openid)"`
	UnionId                   string    `orm:"description(微信开放平台unionid)"`
	SchoolName                string    `orm:"description(学校)"`
	Phone                     string    `orm:"description(电话)"`
	PhoneShow                 string    `orm:"-"`
	Password                  string    `orm:"description(密码)"`
	NickName                  string    `orm:"description(微信昵称)"`
	HeadImgUrl                string    `orm:"description(微信头像)"`
	Status                    int       `orm:"description(状态，0禁用 1正常)"`
	StatusShow                string    `orm:"-"`
	SubscribeStatus           int       `orm:"description(关注公众号状态 0未关注 1已关注 2已取消关注)"`
	SubscribeStatusShow       string    `orm:"-"`
	IsReceiveWechatNotice     int       `orm:"description(是否接收微信通知，0不接收 1接收)"`
	IsReceiveWechatNoticeShow string    `orm:"-"`
	SubscribeTime             time.Time `orm:"type(datetime);null;description(关注公众号时间)"`
	SubscribeTimeShow         string    `orm:"-"`
	UnsubscribeTime           time.Time `orm:"type(datetime);null;description(取消关注公众号时间)"`
	UnsubscribeTimeShow       string    `orm:"-"`
	Created                   time.Time `orm:"auto_now_add;type(datetime);description(创建时间)"`
	CreatedShow               string    `orm:"-"`
	Updated                   time.Time `orm:"auto_now;type(datetime);description(最后一次更新时间)"`
	UpdatedShow               string    `orm:"-"`
}

func init() {
	UserSubscribeStatus = map[int]string{
		0: "未关注",
		1: "已关注",
		2: "已取消关注",
	}

	UserStatus = map[int]string{
		0: "禁用",
		1: "正常",
	}

	UserIsReceiveWechatNotice = map[int]string{
		0: "不接收",
		1: "接收",
	}
}
